<div class="bjui-row col-1">
    <label class="row-label" style="width: 14%">系统设备容量:</label>
    <div class="row-input" style="width: 86%!important;">
        <input type="text" style="width: 200px" name="memo" id="roles-memo" value="1000" disabled>
    </div>
    <br/>
    <label class="row-label" style="width: 14%">初始地图位置:</label>
    <div class="row-input" style="width: 86%!important;">
        <button id="sysPositionSave" class="btn-blue1 btn" data-icon="save" onclick="sysMapPositionSave()"><i class="fa fa-save"></i> 保存
        </button>
    </div>
</div>
<div id="sysMap" style="margin-top: 10px;">
    <div style="width:70%;height:400px; margin-left:14%;border:#ccc solid 1px;font-size:12px" id="InitializationPosition"></div>
</div>
<input type="hidden" id="sysLat" name="lat">
<input type="hidden" id="sysLng" name="lng">
<script>
    var sysMap;
    $(function () {
        $("#sysPositionSave").attr("disabled",true);
        sysMap = new BMap.Map("InitializationPosition");
        sysMap.centerAndZoom(new BMap.Point(${centerLng}, ${centerLat}), 12);
        sysMap.enableScrollWheelZoom(true);// 初始化地图,设置城市和地图级别。
        var point = new BMap.Point(${centerLng},${centerLat});
        var marker=new BMap.Marker(point,12);
        sysMap.addOverlay(marker);
        //单击获取点击的经纬度
        sysMap.addEventListener("click",function(e){
            $("#sysPositionSave").attr("disabled",false);
            sysMap.clearOverlays();
            point = new BMap.Point(e.point.lng,e.point.lat);
            marker=new BMap.Marker(point,12);
            $("#sysLat").val(e.point.lat);
            $("#sysLng").val(e.point.lng);
            sysMap.addOverlay(marker);
        });
    })
    function sysMapPositionSave() {
        $("#sysPositionSave").attr("disabled",true);
        var location= $("#sysLng").val()+","+$("#sysLat").val();
        $.ajax({
            type:"post",
            url:"/sysmanage/sys/mapCenterConf",
            data:{"location":location},
            dataType: "json",
            success:function (data) {
                if (data.Message == "ok") {
                    var content = "设置成功";
                    BJUI.alertmsg('ok', content);
                    setEditData(snVal);
                }
                else {
                    var content = "设置失败";
                    BJUI.alertmsg('warn', content);
                }
            }
        })
    }

    function initializeredis() {
        $.ajax({
            type: "POST",
            url: "/sysmanage/sys/initializeredis.do",
            data: "",
            dataType: 'json',
            cache: true,
            contentType: "application/json;charset=UTF-8",
            success: function (data) {
                console.log(data);
                BJUI.alertmsg(data.content,data.message)
            }
        })
    }
</script>